Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Update mupen64plus to latest upstream version #4117

Draft
wants to merge 58 commits into
base: master
Choose a base branch
from

Conversation

Morilli
Copy link
Collaborator

@Morilli Morilli commented Nov 15, 2024

Work in progress update of the mupen64plus core to the latest version. This would ideally improve compatibility and increase accuracy and be a real-time playable alternative to the existing ares64 core.

There's a couple of known TODOs that need to be resolved:

  • RSP and RDP plugin choices are not final. Currently the diff contains the angrylion-plus, GLideN64 and paraLLEl RDP plugins and mupen64plus's HLE and cxd4 RSP plugins and the paraLLEl rsp plugin. Apparently mupen-rr uses better-gln64 which may be worth considering for its high speed.
  • sync settings for plugins need to be implemented; those are currently all default because no choices exist
  • integrate mupen core and plugin sources and build in the bizhawk repo; I currently build from a fork that is not checked in to bizhawk (https://github.com/Morilli/mupen64plus-core/tree/bizhawk) <-- done, TODO build instructions / automatic build script for core and all plugins
  • IDebuggable functionality is missing, mainly because registers aren't implemented. Registers not being implemented also affects ITraceable impl (why is that required but only exposed in IDebuggable... whatever)
  • the (mupen) debugger has some overhead and should be toggleable
  • compile for linux as well
  • lots of testing, I have no test roms or known complex test games so I can't say whether anything is broken beyond simple game boots working

The diff should be relatively clean, the commit history isn't. Best to look at the full diff instead of individual commits. Some dlls may be missing from Assets, that will need to be fixed once plugins and compile commands are finalized.

this is such a great idea
reading systembus currently crashing the emulator, might need to look into that
TODO:
- allow enabling/disabling debugger dynamically, it really doesn't need to be on permanently, requires a mupen-side change tho
- provide registers
- figure out why size of mupen went +800kb, is it just -lopcodes, -lintl, -liberty?
- debugger (trace and debugger itself) doesn't work in dynarec, notify or unregister services accordingly
- figure out why cached interpreter has <60 fps
see TASEmulators#3220, probably fixes some controller and SDL exceptions i've been observing previously
@vadosnaprimer
Copy link
Contributor

I feel I should let @Wyst3r know about this.

also rebuilt some other stuff from newer source

it... doesn't really work yet
@Morilli
Copy link
Collaborator Author

Morilli commented Nov 17, 2024

The latest commit adds linux binaries which "work", as in everything loads, but I've experienced freezing after 1-100 frames. It's not a crash, just an unresponsiveness forcing me to close the program. I have no idea how to debug this except by adding dozens of console.writelines and trying to narrow down the place it's getting stuck at.

still same issue as before though
@zeromus zeromus removed their request for review November 18, 2024 07:54
@Spikestuff
Copy link

Spikestuff commented Nov 21, 2024

Just for the sake of re-documenting it here and not like somewhere in the Discord (and it is the first todo point).

better gln64 is a high recommended from Mupen64-rr-lua mainly for it having low hardware requirements and better to TAS with.

The only caveat against it from what I can tell is that it's HLE and not LLE and some glitches with certain titles (which some of the plugins already in Hawk has those issues). So in other words it would be a suitable replacement to Rice (so lowest of the low).

And whilst porting it, it's probably beneficial to disable the texture settings (technically you can hide everything, and make it just the plugin, but some people might benefit from disabling fog).

@YoshiRulz YoshiRulz added this to the Mupen64+ update milestone Nov 27, 2024
@Morilli
Copy link
Collaborator Author

Morilli commented Jan 22, 2025

Linux can be fixed to work with all currently checked in binaries by applying the following diff:

diff --git a/Assets/EmuHawkMono.sh b/Assets/EmuHawkMono.sh
index 7ca69f6ea..e695450ac 100755
--- a/Assets/EmuHawkMono.sh
+++ b/Assets/EmuHawkMono.sh
@@ -18,6 +18,7 @@ fi
 export LD_LIBRARY_PATH="$PWD/dll:$PWD:$libpath"
 export MONO_CRASH_NOFILE=1
 export MONO_WINFORMS_XIM_STYLE=disabled # see https://bugzilla.xamarin.com/show_bug.cgi?id=28047#c9
+export MONO_THREADS_SUSPEND=preemptive
 if [ "$1" = "--mono-no-redirect" ]; then
 #	printf "(passing --mono-no-redirect is no longer necessary)\n" #TODO uncomment later
 	shift

Looking at the documentation, it looks like this might be an actual mono bug (maybe mono/mono#14084 ?). Either hybrid (default) or coop values hang for me, just preemptive works without issues.

YoshiRulz added a commit that referenced this pull request Jan 22, 2025
@YoshiRulz
Copy link
Member

YoshiRulz commented Jan 22, 2025

Pre-emptive mode also improved framerates in managed and maybe wbox, so ^ I set it globally. Nice find!

Testing this branch now. Well it doesn't hang and the audio is working, but still no video.
solitaire effect
That's with GLideN64. I tried changing it to angrylion-plus as suggested but got a black screen with no audio.

@Morilli
Copy link
Collaborator Author

Morilli commented Jan 22, 2025

Well it doesn't hang and the audio is working, but still no video.
That's with GLideN64. I tried changing it to angrylion-plus as suggested but got a black screen with no audio.

Could you post the full stdout/stderr output? There should be some logging about plugins in the beginning.

@YoshiRulz
Copy link
Member

GLideN64
running as unprivileged user
HawkFile bound /home/yoshi/Documents/BizHawk/output/gamedb/mame_machines.txt
HawkFile bound /home/yoshi/Documents/BizHawk/output/gamedb/NesCarts.xml
MAME Machine DB load: 00:00:00.0222606 sec
Bootgod DB load: 00:00:00.1173148 sec
throttle method: 1; resolution: 10000000
extra bundled gamedb files were not #included: gamedb_3ds.txt, gamedb_msx2-L.txt, mame_machines.txt, gamedb_Odyssey2.txt, gamedb_msx1-L.txt
GameDB load: 00:00:00.6495401 sec
Using SDL2 for host input (keyboard + gamepads)
HawkFile bound /home/yoshi/Downloads/roms/cam_proj_rev/Super Mario 64 (USA).n64
Game was not in DB. CRC: 3CE60709 MD5: 20B854B239203BAF6C961B850A4A51A2
N64
DEBUG CALLBACK 2: No version number in 'Core' config section. Setting defaults.
DEBUG CALLBACK 2: No version number in 'CoreEvents' config section. Setting defaults.
DEBUG CALLBACK 3: Using full mem base
DEBUG CALLBACK 1: Unable to open rom database file '(null)'.
SUCCESS
SUCCESS
DEBUG CALLBACK 3: Goodname: SUPER MARIO 64 (unknown rom)
DEBUG CALLBACK 3: Name: SUPER MARIO 64      
DEBUG CALLBACK 3: MD5: 20B854B239203BAF6C961B850A4A51A2
DEBUG CALLBACK 3: CRC: 635A2BFF 8B022326
DEBUG CALLBACK 3: Imagetype: .z64 (native)
DEBUG CALLBACK 3: Rom size: 8388608 bytes (or 8 Mb or 64 Megabits)
DEBUG CALLBACK 5: ClockRate = F
DEBUG CALLBACK 3: Version: 1444
DEBUG CALLBACK 3: Manufacturer: Nintendo
DEBUG CALLBACK 5: Cartridge_ID: 4D53
DEBUG CALLBACK 3: Country: USA
DEBUG CALLBACK 5: PC = 80246000
DEBUG CALLBACK 5: Save type: 0
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
DEBUG CALLBACK 2: Input plugin does not contain VRU support.
DEBUG CALLBACK 3: input plugin did not specify a render callback; there will be no on screen display by the input plugin.
SUCCESS
SUCCESS
SUCCESS
SUCCESS
DEBUG CALLBACK 3: Using video capture backend: dummy
DEBUG CALLBACK 3: Using CIC type X102
Attempted to SetVideoMode, width 640, height 480, bpp 0, screenMode WINDOWED, flags SUPPORT_RESIZING
State changed! Param VIDEO_MODE, new value 2
State changed! Param VIDEO_SIZE, new value 41943520
DebugSourceApi DebugTypeOther DebugSeverityNotification: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) will use SYSTEM HEAP memory as the source for buffer object operations.
DebugSourceApi DebugTypeOther DebugSeverityNotification: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast).
DebugSourceApi DebugTypeOther DebugSeverityNotification: Buffer detailed info: Buffer object 2 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) will use SYSTEM HEAP memory as the source for buffer object operations.
DebugSourceApi DebugTypeOther DebugSeverityNotification: Buffer detailed info: Buffer object 2 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast).
DebugSourceApi DebugTypeOther DebugSeverityNotification: Buffer detailed info: Buffer object 3 (bound to GL_ELEMENT_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) will use SYSTEM HEAP memory as the source for buffer object operations.
DebugSourceApi DebugTypeOther DebugSeverityNotification: Buffer detailed info: Buffer object 3 (bound to GL_ELEMENT_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast).
SwapBuffers was called.
SwapBuffers was called.
SwapBuffers was called.
SwapBuffers was called.
SwapBuffers was called.
SwapBuffers was called.
SwapBuffers was called.
SwapBuffers was called.
SwapBuffers was called.
SwapBuffers was called.
SwapBuffers was called.
SwapBuffers was called.
SwapBuffers was called.
SwapBuffers was called.
SwapBuffers was called.
SwapBuffers was called.
SwapBuffers was called.
SwapBuffers was called.
SwapBuffers was called.
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
State changed! Param EMU_STATE, new value 2
DEBUG CALLBACK 3: Initializing 2 RDRAM modules for a total of 4 MB
DEBUG CALLBACK 3: Starting R4300 emulator: Dynamic Recompiler
DEBUG CALLBACK 3: Init new dynarec
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
DebugSourceApi DebugTypeError DebugSeverityHigh: GL_INVALID_OPERATION error generated. The required buffer is missing.
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
DebugSourceApi DebugTypeError DebugSeverityHigh: GL_INVALID_OPERATION error generated. The required buffer is missing.
SwapBuffers was called.
DebugSourceApi DebugTypeOther DebugSeverityNotification: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (2), and GL_ARRAY_BUFFER_ARB, usage hint is GL_STATIC_DRAW) will use VIDEO memory as the source for buffer object operations.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
DebugSourceApi DebugTypeError DebugSeverityHigh: GL_INVALID_OPERATION error generated. The required buffer is missing.
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
DebugSourceApi DebugTypeError DebugSeverityHigh: GL_INVALID_OPERATION error generated. The required buffer is missing.
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
DebugSourceApi DebugTypeError DebugSeverityHigh: GL_INVALID_OPERATION error generated. The required buffer is missing.
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
DebugSourceApi DebugTypeError DebugSeverityHigh: GL_INVALID_OPERATION error generated. The required buffer is missing.
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
DebugSourceApi DebugTypeError DebugSeverityHigh: GL_INVALID_OPERATION error generated. The required buffer is missing.
reading and enqueuing 320 samples
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
DebugSourceApi DebugTypeError DebugSeverityHigh: GL_INVALID_OPERATION error generated. The required buffer is missing.
reading and enqueuing 320 samples
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
DebugSourceApi DebugTypeError DebugSeverityHigh: GL_INVALID_OPERATION error generated. The required buffer is missing.
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
DebugSourceApi DebugTypeError DebugSeverityHigh: GL_INVALID_OPERATION error generated. The required buffer is missing.
reading and enqueuing 1120 samples
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
DebugSourceApi DebugTypeError DebugSeverityHigh: GL_INVALID_OPERATION error generated. The required buffer is missing.
reading and enqueuing 1120 samples
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
DebugSourceApi DebugTypeError DebugSeverityHigh: GL_INVALID_OPERATION error generated. The required buffer is missing.
reading and enqueuing 1120 samples
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
DebugSourceApi DebugTypeError DebugSeverityHigh: GL_INVALID_OPERATION error generated. The required buffer is missing.
reading and enqueuing 1120 samples
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
DebugSourceApi DebugTypeError DebugSeverityHigh: GL_INVALID_OPERATION error generated. The required buffer is missing.
reading and enqueuing 1120 samples
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
DebugSourceApi DebugTypeError DebugSeverityHigh: GL_INVALID_OPERATION error generated. The required buffer is missing.
reading and enqueuing 1088 samples
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
DebugSourceApi DebugTypeError DebugSeverityHigh: GL_INVALID_OPERATION error generated. The required buffer is missing.
reading and enqueuing 1056 samples
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
DebugSourceApi DebugTypeError DebugSeverityHigh: GL_INVALID_OPERATION error generated. The required buffer is missing.
reading and enqueuing 1056 samples
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
DebugSourceApi DebugTypeError DebugSeverityHigh: GL_INVALID_OPERATION error generated. The required buffer is missing.
reading and enqueuing 1056 samples
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
DebugSourceApi DebugTypeError DebugSeverityHigh: GL_INVALID_OPERATION error generated. The required buffer is missing.
reading and enqueuing 1056 samples
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
DebugSourceApi DebugTypeError DebugSeverityHigh: GL_INVALID_OPERATION error generated. The required buffer is missing.
reading and enqueuing 1056 samples
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
DebugSourceApi DebugTypeError DebugSeverityHigh: GL_INVALID_OPERATION error generated. The required buffer is missing.
reading and enqueuing 1056 samples
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
DebugSourceApi DebugTypeError DebugSeverityHigh: GL_INVALID_OPERATION error generated. The required buffer is missing.
reading and enqueuing 1056 samples
SwapBuffers was called.
entering dispose...
DEBUG CALLBACK 4: Stopping emulation.
State changed! Param EMU_STATE, new value 2
State changed! Param EMU_STATE, new value 2
SUCCESS
DEBUG CALLBACK 3: R4300 emulator finished.
State changed! Param VIDEO_MODE, new value 1
State changed! Param EMU_STATE, new value 1
DEBUG CALLBACK 4: Rom closed.
BizHawk has completed its shutdown routines, killing process...
angrylion-plus
running as unprivileged user
HawkFile bound /home/yoshi/Documents/BizHawk/output/gamedb/mame_machines.txt
HawkFile bound /home/yoshi/Documents/BizHawk/output/gamedb/NesCarts.xml
MAME Machine DB load: 00:00:00.0244529 sec
Bootgod DB load: 00:00:00.1245037 sec
throttle method: 1; resolution: 10000000
extra bundled gamedb files were not #included: gamedb_3ds.txt, gamedb_msx2-L.txt, mame_machines.txt, gamedb_Odyssey2.txt, gamedb_msx1-L.txt
GameDB load: 00:00:00.6678550 sec
Using SDL2 for host input (keyboard + gamepads)
HawkFile bound /home/yoshi/Downloads/roms/cam_proj_rev/Super Mario 64 (USA).n64
Game was not in DB. CRC: 3CE60709 MD5: 20B854B239203BAF6C961B850A4A51A2
N64
DEBUG CALLBACK 2: No version number in 'Core' config section. Setting defaults.
DEBUG CALLBACK 2: No version number in 'CoreEvents' config section. Setting defaults.
DEBUG CALLBACK 3: Using full mem base
DEBUG CALLBACK 1: Unable to open rom database file '(null)'.
SUCCESS
SUCCESS
DEBUG CALLBACK 3: Goodname: SUPER MARIO 64 (unknown rom)
DEBUG CALLBACK 3: Name: SUPER MARIO 64      
DEBUG CALLBACK 3: MD5: 20B854B239203BAF6C961B850A4A51A2
DEBUG CALLBACK 3: CRC: 635A2BFF 8B022326
DEBUG CALLBACK 3: Imagetype: .z64 (native)
DEBUG CALLBACK 3: Rom size: 8388608 bytes (or 8 Mb or 64 Megabits)
DEBUG CALLBACK 5: ClockRate = F
DEBUG CALLBACK 3: Version: 1444
DEBUG CALLBACK 3: Manufacturer: Nintendo
DEBUG CALLBACK 5: Cartridge_ID: 4D53
DEBUG CALLBACK 3: Country: USA
DEBUG CALLBACK 5: PC = 80246000
DEBUG CALLBACK 5: Save type: 0
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
DEBUG CALLBACK 2: Input plugin does not contain VRU support.
DEBUG CALLBACK 3: input plugin did not specify a render callback; there will be no on screen display by the input plugin.
SUCCESS
SUCCESS
SUCCESS
SUCCESS
DEBUG CALLBACK 3: Using video capture backend: dummy
DEBUG CALLBACK 3: Using CIC type X102
Attempted to SetVideoMode, width 640, height 480, bpp 0, screenMode WINDOWED, flags SUPPORT_RESIZING
State changed! Param VIDEO_MODE, new value 2
State changed! Param VIDEO_SIZE, new value 41943520
State changed! Param EMU_STATE, new value 2
State changed! Param EMU_STATE, new value 2
DEBUG CALLBACK 3: Initializing 2 RDRAM modules for a total of 4 MB
DEBUG CALLBACK 3: Starting R4300 emulator: Dynamic Recompiler
DEBUG CALLBACK 3: Init new dynarec
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
SwapBuffers was called.
DebugSourceApi DebugTypeOther DebugSeverityNotification: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (2), and GL_ARRAY_BUFFER_ARB, usage hint is GL_STATIC_DRAW) will use VIDEO memory as the source for buffer object operations.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
SwapBuffers was called.
reading and enqueuing 320 samples
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
reading and enqueuing 320 samples
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
SwapBuffers was called.
reading and enqueuing 1120 samples
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
reading and enqueuing 1120 samples
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
SwapBuffers was called.
reading and enqueuing 1120 samples
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
SwapBuffers was called.
reading and enqueuing 1120 samples
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
SwapBuffers was called.
reading and enqueuing 1120 samples
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
SwapBuffers was called.
reading and enqueuing 1088 samples
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
reading and enqueuing 1056 samples
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
SwapBuffers was called.
reading and enqueuing 1056 samples
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
SwapBuffers was called.
reading and enqueuing 1056 samples
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
reading and enqueuing 1056 samples
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
SwapBuffers was called.
reading and enqueuing 1056 samples
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
SwapBuffers was called.
reading and enqueuing 1056 samples
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
reading and enqueuing 1056 samples
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
reading and enqueuing 1056 samples
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
SwapBuffers was called.
reading and enqueuing 1056 samples
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
SwapBuffers was called.
reading and enqueuing 1056 samples
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
reading and enqueuing 1056 samples
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
reading and enqueuing 1056 samples
SwapBuffers was called.
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
SwapBuffers was called.
reading and enqueuing 1056 samples
State changed! Param EMU_STATE, new value 2
SUCCESS
SwapBuffers was called.
State changed! Param EMU_STATE, new value 3
SwapBuffers was called.
reading and enqueuing 1088 samples
entering dispose...
DEBUG CALLBACK 4: Stopping emulation.
State changed! Param EMU_STATE, new value 2
State changed! Param EMU_STATE, new value 2
SUCCESS
DEBUG CALLBACK 3: R4300 emulator finished.
State changed! Param VIDEO_MODE, new value 1
State changed! Param EMU_STATE, new value 1
DEBUG CALLBACK 4: Rom closed.
BizHawk has completed its shutdown routines, killing process...

@Morilli
Copy link
Collaborator Author

Morilli commented Jan 22, 2025

Hmm, those logs look proper, nothing out of the ordinary there. Note that for angrylion-plus, the rsp plugin must be set to cxd4-sse2, otherwise there will be no audio or video.

@YoshiRulz
Copy link
Member

Oh, that fixes it, now I can get in-game and it's almost playable (mostly stable 50 fps).

@CasualPokePlayer
Copy link
Member

Looking at the documentation, it looks like this might be an actual mono bug (maybe mono/mono#14084 ?). Either hybrid (default) or coop values hang for me, just preemptive works without issues.

Looking at how that works, it does somewhat make sense. You have a pure native thread being created (in this case the "render thread"), without the runtime having any knowledge of them (since they weren't made with managed APIs). As such, it doesn't really know of such a thread needing to be suspended for GC purposes. This is all fine, as long as that thread remains in unmanaged land, and thus doesn't touch managed state. Once it tries to come back to managed land (via a callback), things go very poorly.

@YoshiRulz YoshiRulz mentioned this pull request Jan 25, 2025
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants